package com.stu.shiro.service;

import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**
 * @author MI
 * @ClassName ISysMenuService.java
 * @createTime 2021年08月25日 15:34:00
 */
@Service
public class ISysMenuService {
    private final Map<Integer, Set<String>> map = new HashMap<>();

    @PostConstruct
    public void init() {
        Set<String> set = new HashSet<>();
        set.add("view");
        set.add("add");
        Set<String> set2 = new HashSet<>();
        set2.add("view");

        map.put(1, set);
        map.put(2, set2);
    }

    public Set<String> findUserPermissionsByUserId(Integer userId) {
        return map.get(userId);
    }
}
